package com.xzkydz.all_sensor.fragment;

import android.app.Fragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.xzkydz.all_sensor.activity.MainActivity;
import com.xzkydz.all_sensor.allsensor.R;

/**
 * Created by Smilekun on 2016/8/26.
 */
public class WeiYiFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View  view  =  inflater.inflate(R.layout.fragment_weiyi, container, false);
        final MainActivity mActivity  = (MainActivity)getActivity();

        Button  button3 =  (Button)view.findViewById(R.id.btn_3);
        Button  button4 =  (Button)view.findViewById(R.id.btn_4);
        Button  button5 =  (Button)view.findViewById(R.id.btn_5);
        Button  button6 =  (Button)view.findViewById(R.id.btn_6);
        Button  button7 =  (Button)view.findViewById(R.id.btn_7);
        Button  button8 =  (Button)view.findViewById(R.id.btn_8);
        Button  button9 =  (Button)view.findViewById(R.id.btn_9);
        Button  button10 = (Button)view.findViewById(R.id.btn_10);
        Button  button11=  (Button)view.findViewById(R.id.btn_11);
        Button  button12=  (Button)view.findViewById(R.id.btn_12);
        Button  button13=  (Button)view.findViewById(R.id.btn_13);

        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010203AC");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010204AB");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010205AA");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010206A9");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010207A8");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010208A7");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A6010209A6");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button10.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A601020AA5");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button11.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A601020BA4");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button12.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A601020CA3");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });
        button13.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.sendPortData("4B590801020001A601020DA2");
                Toast.makeText(mActivity,"已校准...",Toast.LENGTH_SHORT).show();
            }
        });




        return  view ;
    }
}
